VdGeneral - General purpose virtual devices
Status:
This information applies to vdGeneral version 1.1.12.21
Contents:
- Overview
- vdMass - virtual device for separator mass calculation
- vdMultiConnect - virtual device for one to many control
- vdTableConnect - virtual device for table mapped control
- vdFAF - virtual device for FAF function generator
Other links:
Overview
The vdGeneral device is a common library (dll) for general-purpose virtual devices for the ConSys control system.
This virtual device is used to calculate the ion mass for a standard separator. The mass calculation is based on the acceleration voltage and the magnet field measured by a hall probe:
where the following parameters are calibration constants, which can be set by the operator as standard ConSys parameters. The parameters are stored in the registry of the front-end computer where the device is installed.
k: calibration scale constant.
q: ion charge.
Uoffset: Acceleration voltage offset.
Mass-offset: Offset.
The parameters
B: Magnet field measured by a Hall probe
Uacc: Acceleration voltage.
are the measured values for the mass calculation. The vdMass device connects to these parameters to obtain data for the mass calculation.
VdMass setup (ConSys manager):
The parameter names for the magnet field and acceleration voltage is set in the ConSys manager when the virtual device is defined on a front-end computer. The fields to be set by the ConSys manager are:
Vd Mass Id: A unique number for the mass device on the given front-end (used to identify settings for the device stored in the registry).
Hall probe: The full qualified name for the hall probe (<Parameter name>.<Surname>)
Acceleration voltage: The full qualified name for the acceleration voltage. Usually, the control value is given to avoid (false ?) jitter from the HV supply.
Addressing:
For address Definition the device uses AddTypeId number 9 (One-dim address) which uses a0 to determine the parameter number.
parameter |
Suggested |
Parameter description |
Data Type |
Mode |
Interpretation |
Comment |
0 |
Mass |
mass [amu] |
Float |
R |
Unipolar floating point |
The mass calculated by the device. |
1 |
K |
Calibration |
Float |
R/W |
Unipolar Float. |
|
2 |
Q |
Charge |
Float |
R/W |
Bipolar Float. |
|
3 |
Offset |
Mass offset |
Float |
R/W |
Bipolar Float. |
|
4 |
HVOffset |
Acceleration voltage offset |
Float |
R/W |
Bipolar Float. |
|
5 |
Reset |
Resets the device |
Bit (pulsed) |
R/W |
Bit, checkbox, pushbutton. |
Creates a new client connection. |
This device is used to connect a set of parameters together in a single parameter. The connected parameters are defined during device set-up. Read and write data are treated separately. The mean value is calculated for both sets independent of each other. Data written to the device write channel is distributed to all enabled write parameters. Only enabled parameters are included in the mean calculations. R/W parameters are treated as write parameters.
For address Definition the device uses AddTypeId number 9 (One-dim address).
parameter |
Suggested |
Parameter description |
Data Type |
Mode |
Interpretation |
Comment |
0 |
Reset |
Resets the device |
Bit (pulsed) |
W |
Bit, checkbox, pushbutton. |
Creates a new client connection. |
1 |
Write |
Write channel |
Double |
W |
Float |
Write: Set all enabled fields to the write value. |
2 |
Write_mean |
Write status |
Double |
R |
Float |
Read: Mean value of all enabled write parameters. 0 if no write parameters enabled. |
3 |
Read_mean |
Read mean value |
Double |
R |
Float |
Mean value of all enabled read parameters. 0 if no read parameters enabled. |
4 |
Skip_zero |
Skip zero values |
Bit |
W |
Bit, Checkbox |
If set, all parameters with data value zero are skipped from the mean calculation. |
100 ... 99 + <no of par> |
Enable_X |
Enable parameter X |
Bit |
W |
Bit, Checkbox |
Enable/Disable parameters. Only enabled parameters contributes to the calculated mean values. |
500 ... 499 + <no of par> |
Val_X |
Value X |
Double |
R |
Float |
Relayed floating point value. |
The table connect virtual device is used to bind two double control values together - typical used for calibration purposes.
The table connect device can (from version 1.1.12.21) specify an optional storage file for the start up table settings. If a storage file is specified an activated during device setup (with the ConSysManager), the device store/restore the table settings to the specified file during shut down/start up.
For address Definition the device uses AddTypeId number 9 (One-dim address) which uses a0 to determine the parameter number.
parameter |
Suggested |
Parameter description |
Data Type |
Mode |
Interpretation |
Comment |
0 |
Reset |
Resets the device |
Bit (pulsed) |
R/W |
Bit, checkbox, pushbutton. |
Creates a new client connection. |
1 |
Count |
No of table loads. |
Word |
R |
|
|
2 |
Status |
Load Status |
String |
R |
String |
Status string/error messages |
3 |
Table |
Table data |
DataPacket |
W |
|
See note below for table data format |
4 |
Index |
Table Index |
Word |
R/W |
Word |
Select connection table |
5 |
MtoS |
Master to Slave |
Bit |
R/W |
Checkbox |
Enable master to slave connection |
6 |
StoM |
Slave to Master |
Bit |
R/W |
Checkbox |
Enable slave to master connection |
7 |
CnvStts |
Last conversion status |
Word |
R |
N state bitmap (base id 5100) |
0: Cnv ok, 1: No tables loaded, 2: last conversion hit low limit, 3: last conversion hit high limit. |
8 | Header | Identification string from data file | String | R | String | |
9 | reset | Reset | Bit | W | ||
10 | descr | Description of selected Index | String | R | String |
|
Table data
The table data are loaded through parameter 3, 'Table'. When a new set of tables is loaded, all previous tables are deleted. The table set format is a ConSys data packet with the following layout:
CDataPacket TableN: CConSysWord <key> CConSysDoubleArray <slave data> CConSysDoubleArray <master data> .... Table2: CConSysWord <key> CConSysDoubleArray <slave data> CConSysDoubleArray <master data> Table1: CConSysWord <key> CConSysDoubleArray <slave data> CConSysDoubleArray <master data> CConSysString <Header> CConSysWord <DefaultTable key>
Table loader program
The table data is loaded with a special program, TableLoader. This is a small program to read a "*.tbl" table file and send it to the table conversion device in the packet format specified above. The file format is text based with the first character in each line acting as a format key.
P<VDTableConnect parameter name, table key># ; This parameter must be specified. Inclose the parameter name in "" D<Default table key># ; Optional default table selection C<Comment> ; Comments - not parsed H<Header># ; Conversion table header name - stored with the table in the ; device. Inclose the Header string in "". I<Key># ; Table key - must proceed each table T<Source data>;<Destination data># ; Data set in table. Must be defined in increasing source data order ; It is allowed with ekstra spaces. Example: P"TABLECONV_TST.table"# D2# H"This is the header."# I1# T4;100# T40;200# I2# T5;10# T7;20# T8;25#
The FAF virtual device works together with the DAFLoader to control the intelligence of the FAF (Ion RF system on ASTRID) system. The device store the values needed to convert from physical values to the technical values needed in the hardware. The values are set from the DAF loader. By convention, the parameter name for the FAF VD must be the corresponding FAF control parameter + 'VD' (This is how the DAFLoader locates the VD). Example: FAF control parameter name: CRI31SELast, VD parameter name: CRI31SELastVD.
The FAF table setup:
Destination Frequency (parameter name.surname): The name of the ConSys parameter, which contains the FAF control frequency
Read back Frequency (parameter name.surname): The FAF read back frequency
Destination Multiplication, LOW: parameter name of FAF multiplication low word
Destination Multiplication, HIGH: parameter name of FAF multiplication high word
All fields accept drag/drop.
For address Definition the device uses AddTypeId number 9 (One-dim address) which uses a0 to determine the parameter number.
parameter |
Suggested |
Parameter description |
Data Type |
Mode |
Interpretation |
Comment |
0 |
src_freq |
Source frequency |
double |
R/W |
0-1000 MHz |
The surname MUST BE src_freq - used by DAFLoader to locate device. Set from DAFLoader. |
1 |
dest_freq |
Copy of the calculated frequency |
double |
R |
0-1000 MHz |
|
2 |
mass |
Mass |
double |
R/W |
amu |
Set from DAFLoader |
3 |
charge |
Charge |
double |
R/W |
|
Set from DAFLoader |
4 |
harm_no |
Harmonic number |
word |
R/W |
|
Set from DAFLoader |
5 |
E_start |
Start Energy |
double |
R/W |
MeV |
Set from DAFLoader |
6 |
E_low |
Low energy limit |
double |
R/W |
MeV |
Set from DAFLoader |
7 |
E_high |
High energy limit |
double |
R/W |
MeV |
Set from DAFLoader |
8 |
E_beam |
Calc. Beam energy |
double |
R |
MeV |
Based on frequency read back from FAF |
9 |
freq_corr |
Frequency correction |
double |
R/W |
+- 10 0/00 |
The VD use this number to correct the start frequency set in src_freq and sends the result to the registered dest. parameter. A copy can be read through dest_freq (adr 1). |
10 |
src_mult |
FAF multiplication source |
double |
R/W |
0-8388608 |
The source multiplication for the FAF mult. Used together with field 12 (mult_corr) to calculate FAF mult. |
11 |
dest_mult |
Copy of corrected mult send to FAF |
double |
R |
0-8388608 |
|
12 |
mult_corr |
Multiplication correction |
double |
R/W |
+- 10 0/00 |
The VD use this number to correct the multiplication set in src_mult and sends the result to the registered dest. mult (split to two words, Low and High). A copy can be read through dest_mult (adr 11). |
Last Modified 06 May 2020